Imports System.Windows.Forms
Imports Pacientes

Public Class MenuLabs

    Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)
        ' Cree una nueva instancia del formulario secundario.
        Dim ChildForm As New System.Windows.Forms.Form
        ' Conviértalo en un elemento secundario de este formulario MDI antes de mostrarlo.
        ChildForm.MdiParent = Me

        m_ChildFormNumber += 1
        ChildForm.Text = "Ventana " & m_ChildFormNumber

        ChildForm.Show()
    End Sub

    Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs)
        Dim OpenFileDialog As New OpenFileDialog
        OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        OpenFileDialog.Filter = "Archivos de texto (*.txt)|*.txt|Todos los archivos (*.*)|*.*"
        If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
            Dim FileName As String = OpenFileDialog.FileName
            ' TODO: Agregar código aquí para abrir el archivo.
        End If
    End Sub

    Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim SaveFileDialog As New SaveFileDialog
        SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        SaveFileDialog.Filter = "Archivos de texto (*.txt)|*.txt|Todos los archivos (*.*)|*.*"

        If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
            Dim FileName As String = SaveFileDialog.FileName
            ' TODO: agregar código aquí para guardar el contenido actual del formulario en un archivo.
        End If
    End Sub


    Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Global.System.Windows.Forms.Application.Exit()
    End Sub

    Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        ' Utilice My.Computer.Clipboard para insertar el texto o las imágenes seleccionadas en el Portapapeles
    End Sub

    Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        ' Utilice My.Computer.Clipboard para insertar el texto o las imágenes seleccionadas en el Portapapeles
    End Sub

    Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        'Utilice My.Computer.Clipboard.GetText() o My.Computer.Clipboard.GetData para recuperar la información del Portapapeles.
    End Sub

    Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Me.LayoutMdi(MdiLayout.Cascade)
    End Sub

    Private Sub TileVerticleToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Me.LayoutMdi(MdiLayout.TileVertical)
    End Sub

    Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Me.LayoutMdi(MdiLayout.TileHorizontal)
    End Sub

    Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Me.LayoutMdi(MdiLayout.ArrangeIcons)
    End Sub

    Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        ' Cierre todos los formularios secundarios del primario.
        For Each ChildForm As Form In Me.MdiChildren
            ChildForm.Close()
        Next
    End Sub

    Private m_ChildFormNumber As Integer = 0

    
    Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
        Select Case e.Node.Name
            Case "mnuActPac" : frmActDatosPacienteCORREGIDO.Show(Me)
            Case "mnuActualizar" : TurnosCORREGIDO.Show(Me)
            Case "mnuPrecioEst" : frmCalcularMontos.Show(Me)
            Case "mnuRepPac" : FrmHemograma.Show(Me)
            Case "mnuDatosProf" : frmOrina.Show(Me)
            Case "mnuRepObraSoc" : frmBuscarPaciente.Show(Me)
            Case "mnuConsModEst" : frmModificarFIa.Show(Me)
            Case "mnuOrina" : RdoOrina.Show(Me)
            Case "mnuAgua" : frmAnalisisAgua.Show(Me)

        End Select

    End Sub

    Private Sub MenuLabs_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conexion = New ConexionBD(cadenaConexion)
        conexion.ConexionBase.Open()
    End Sub

    Private Sub cmdAsignarTurnos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAsignarTurnos.Click
        'Dim frm As TurnosCORREGIDO = New TurnosCORREGIDO()
        'frm.ShowDialog(Me)
        'frm.Dispose()
        TurnosCORREGIDO.Visible = False
        TurnosCORREGIDO.Show(Me)
    End Sub

    Private Sub cmdCalMonto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCalMonto.Click
        'Dim frm As frmCalcularMontos = New frmCalcularMontos()
        'frm.ShowDialog(Me)
        'frm.Dispose()
        frmCalcularMontos.Visible = False
        frmCalcularMontos.Show(Me)
    End Sub

    Private Sub cmdActPac_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdActPac.Click
        'Dim frm As frmActDatosPacienteCORREGIDO = New frmActDatosPacienteCORREGIDO()
        'frm.ShowDialog(Me)
        'frm.Dispose()
        frmActDatosPacienteCORREGIDO.Visible = False
        frmActDatosPacienteCORREGIDO.Show(Me)
    End Sub

    Private Sub cmdAgenda_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAgenda.Click
        'Dim frm As frmTurnos = New frmTurnos()
        'frm.ShowDialog(Me)
        'frm.Dispose()
        frmTurnos.Visible = False
        frmTurnos.Show(Me)
    End Sub
End Class
